Getting the ID of the element that fired an event

73

Getting the ID of the element that fired an event -

$(document).ready(function() {
    $("a").click(function(event) {
        alert(event.target.id);
    });
});

Comments

Submit
0 Comments